package com.yuanmeng.common.core.enums;

import com.yuanmeng.common.core.exception.ServiceException;
import lombok.Getter;

/**
 * @author outsider
 * @version Id: ApplyStatusEnum.java, v 0.1 2020/12/16 18:23 outsider Exp $$
 */
@Getter
public enum TeamTypeEnum {
    INVITATION_TEAM("INVITATION_TEAM", "邀请团队"),

    DISTRIBUTION_TEAM("DISTRIBUTION_TEAM", "分销团队");

    private String code;

    private String message;

    TeamTypeEnum(String code, String message) {
        this.code = code;
        this.message = message;
    }

    public static void validateTeamType(String teamType) {
        int num = 0;
        for(TeamTypeEnum ENUM : TeamTypeEnum.values()) {
            if(ENUM.code.equals(teamType)) {
                num ++;
            }
        }
        if(num == 0) {
            throw new ServiceException("请求参数非法: teamType");
        }
    }
}
